#include <iostream>
#include <string>
#include <cctype>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;

string str;
vector<string> words, ananagrams;
map<string, int> counter;

string represent(const string&);

int main() {
  while (cin >> str) {
    if (str[0] == '#') {
      break;
    }

    words.push_back(str);
    string stdstr = represent(str);
    if (!counter.count(stdstr)) {
      counter[stdstr] = 0;
    }
    counter[stdstr]++;
  }

  int i, size;
  for (i = 0, size = words.size(); i < size; i++) {
    if (counter[represent(words[i])] == 1) {
      ananagrams.push_back(words[i]);
    }
  }

  sort(ananagrams.begin(), ananagrams.end());
  for (i = 0, size = ananagrams.size(); i < size; i++) {
    cout << ananagrams[i] << "\n";
  }

  return 0;
}

string represent(const string& s) {
  string stdstr = s;
  int i, strlen = stdstr.length();
  for (i = 0; i < strlen; i++) {
    stdstr[i] = tolower(stdstr[i]);
  }
  sort(stdstr.begin(), stdstr.end());
  return stdstr;
}
